package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserZodiacChina;
import com.culturalCenter.dataCenter.mapper.user.UserZodiacChinaMapper;
import com.culturalCenter.dataCenter.service.user.UserZodiacChinaService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserZodiacChina业务层接口实现类
 * @Date
 *****/
@Service
public class UserZodiacChinaServiceImpl implements UserZodiacChinaService {

    @Resource
    private UserZodiacChinaMapper userZodiacChinaMapper;

    @Override
    public PageInfo<UserZodiacChina> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userZodiacChinaMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userZodiacChinaMapper.deleteById(id);
    }

    @Override
    public Integer update(UserZodiacChina userZodiacChina) {
        return userZodiacChinaMapper.update(userZodiacChina);
    }

    @Override
    public Integer add(UserZodiacChina userZodiacChina) {
        return userZodiacChinaMapper.insert(userZodiacChina);
    }

    @Override
    public UserZodiacChina findById(String id) {
        return userZodiacChinaMapper.queryById(id);
    }

    @Override
    public List<UserZodiacChina> findAll(UserZodiacChina userZodiacChina) {
        return (List<UserZodiacChina>) userZodiacChinaMapper.queryAll(userZodiacChina);
    }

}
